package com.ruoyi.system.api;

import com.ruoyi.system.api.domain.*;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;
import com.ruoyi.common.core.constant.SecurityConstants;
import com.ruoyi.common.core.constant.ServiceNameConstants;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.system.api.factory.RemoteUserFallbackFactory;
import com.ruoyi.system.api.model.LoginUser;

/**
 * 用户服务
 * 
 * @author ruoyi
 */
@FeignClient(contextId = "remoteUserService", value = ServiceNameConstants.SYSTEM_SERVICE, fallbackFactory = RemoteUserFallbackFactory.class)
public interface RemoteUserService
{
    /**
     * 通过用户名查询用户信息
     *
     * @param username 用户名
     * @param source 请求来源
     * @return 结果
     */
    @GetMapping("/user/info/{username}")
    public R<LoginUser> getUserInfo(@PathVariable("username") String username, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    /**
     * 注册用户信息
     *
     * @param sysUser 用户信息
     * @param source 请求来源
     * @return 结果
     */
    @PostMapping("/user/register")
    public R<Boolean> registerUserInfo(@RequestBody SysUser sysUser, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    @PutMapping("/dept/pic")
    public R<Integer> updateDeptPic(@RequestBody SysDept dept);

    @GetMapping("/picture/pic/{productId}")
    public R<ShProductPicture> getProductPic(@PathVariable("productId") Long productId);

    @PostMapping("/picture/add")
    public R<Integer> addPicturePic(@RequestBody ShProductPicture shProductPicture);

    @PostMapping("/bannerpic/add")
    public R<Integer> addBannerPic(@RequestBody ShBannerPicture shBannerPicture);

    @PostMapping("/picture/del/{id}")
    public R<Integer> delPicturePic(@PathVariable("id") Long id);

    @PostMapping("/bannerpic/del/{id}")
    public R<Integer> delBannerPic(@PathVariable("id") Long id);

    @PutMapping("/teacher/pic")
    public R<Integer> editTeacherPic(@RequestBody ShCourseTeacher shCourseTeacher);

    @GetMapping("/course/pic/{id}")
    public R<ShCourse> getCourse(@PathVariable("id") Long id);

    @PutMapping("/course/pic")
    public R<Integer> editCoursePic(@RequestBody ShCourse shCourse);

    @GetMapping("/info/get/{id}")
    public R<MaterialInfo> getMaterialZl(@PathVariable("id") Long id);

    @GetMapping("/info/getSize/{size}")
    public R<MaterialInfo> getMaterialZlsize(@PathVariable("size") Long size);

    @PutMapping("/info/zl")
    public R<Integer> editMaterialZl(@RequestBody MaterialInfo materialInfo);
}
